﻿@{
    ViewData["Title"] = "TreeIndex";
    Layout = "~/Views/Shared/_TabLayoutIndex.cshtml";
}
<div class="layui-fluid">
    <form class="layui-form">
        <div class="layui-form-item">
            <label class="layui-form-label">角色名称</label>
            <div class="layui-input-block">
                <input class="layui-input" type="text" name="name" placeholder="请输入角色名称" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">选择权限</label>
            <div class="layui-input-block">
                <div id="LAY-auth-tree-index"></div>
            </div>
        </div>
    </form>
</div>
@section Scripts {
<script src="~/js/aju.Carefree.Layer.js"></script>
<script src="~/js/aju.Carefree.Authtree.js"></script>
<script>
    var r = Authtree("/Demo/GetTreeData", "#LAY-auth-tree-index");
    function submitForm(index)
    {
        //得到字节点的值
        console.log(getAuthtreeLeafValue("#LAY-auth-tree-index"));
        //得到所有选中节点的值
        console.log(getAuthtreeCheckedValue("#LAY-auth-tree-index"));
    }
</script>
}